package connect4client.commands;


import messages.GiveUpMessage;


/**
 * The GiveUp command.
 * 
 * This command will handle GiveUp messages.
 */
public class GiveUpCommand extends Command {

	public GiveUpCommand(GiveUpMessage chatMessage){
		super(chatMessage);
	}
	
	@Override
	public void execute() {
		GiveUpMessage message = ((GiveUpMessage)this.message);	
		controller.getGameManager().removeMatch(message.getMatchId());
		guiMediator.giveUp(message.getMatchId());	
	}
}
